﻿using System.Collections.Generic;
using System.Reflection;

namespace LINQPad.OpenAccess.Metadata
{
    /// <summary>
    /// Used to parse the context types and metadata sources from an assembly.
    /// </summary>
    public interface IAssemblyParser
    {
        /// <summary>
        /// Discovers the context types.
        /// </summary>
        /// <param name="assembly">The assembly.</param>
        /// <returns>
        /// The context types.
        /// </returns>
        IEnumerable<IContextTypeInfo> DiscoverContextTypes( Assembly assembly );
        /// <summary>
        /// Discovers the metadata sources.
        /// </summary>
        /// <param name="assembly">The assembly.</param>
        /// <returns>
        /// The metadata sources.
        /// </returns>
        IEnumerable<IMetadataSourceInfoWithSource> DiscoverMetadataSources( Assembly assembly );

        /// <summary>
        /// Parses the specified assembly.
        /// </summary>
        /// <param name="assembly">The assembly.</param>
        /// <returns>The parse result.</returns>
        IAssemblyParseResult Parse( Assembly assembly );
        /// <summary>
        /// Parses the specified assembly file.
        /// </summary>
        /// <param name="assemblyFile">The assembly file.</param>
        /// <returns>
        /// The parse result.
        /// </returns>
        IAssemblyParseResult Parse( string assemblyFile );
    }
}